package com.sxran.im.handler;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sxran.im.controller.ImController;
import com.sxran.im.dao.ImFriendMapper;
import com.sxran.im.dao.ImNotificationMapper;
import com.sxran.im.info.ImFriend;
import com.sxran.im.info.ImNotification;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class DeleteFriendCmdHandler extends AbstractCmdHandler<ImFriend>{
    @Resource
    private ImFriendMapper imFriendMapper;

    @Override
    public Object doBeanService(ImFriend json) {
        String curUserId = ImController.getCurUserId();
        json.setUserId(curUserId);
        LambdaQueryWrapper<ImFriend> queryWrapper = new LambdaQueryWrapper<>(json);
        // 删除对应的会话内容。
        imFriendMapper.delete(queryWrapper);
        return json;
    }



}
